<script setup lang="ts">
// import { onMounted } from 'vue';
// import { useRoute } from 'vue-router';
// 获取当前页面的路由对象
// const route = useRoute()
// onMounted(() => {
//   console.log(route.params);
// })
</script>

<template>
  <div class="search">
    <!-- 这里直接用route的参数 直接写$route -->
    <p>搜索关键字: {{ $route.params.words }}</p>
    <p>搜索结果: </p>
    <ul>
      <li>.............</li>
      <li>.............</li>
      <li>.............</li>
      <li>.............</li>
    </ul>
  </div>
</template>

<style>
.search {
  width: 400px;
  height: 240px;
  padding: 0 20px;
  margin: 0 auto;
  border: 2px solid #c4c7ce;
  border-radius: 5px;
}
</style>